FROM centos:7
MAINTAINER yangdj 2020-10-28

# 准备 JDK/Tomcat 系统变量
ENV JAVA_HOME /usr/java/latest
ENV WORKSPACE /home/admin/
ENV CATALINA_HOME /home/admin/apache-tomcat-8.5.59
ENV PATH $PATH:$JAVA_HOME/bin:$CATALINA_HOME/bin

# 设置容器的环境
RUN ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
    echo "Asia/shanghai" > /etc/timezone && yum clean all && \
    yum -y install kde-l10n-Chinese glibc-common wget unzip && \
    localedef -c -f UTF-8 -i zh_CN zh_CN.utf8 && \
    mkdir /home/admin && \
    yum clean all

ENV LC_ALL "zh_CN.UTF-8"

# 下载安装 Tomcat8.5.59
RUN wget http://edas-hz.oss-cn-hangzhou.aliyuncs.com/agent/prod/files/jdk-8u65-linux-x64.rpm -O /tmp/jdk-8u65-linux-x64.rpm && \
    yum -y install /tmp/jdk-8u65-linux-x64.rpm && \
     rm -rf /tmp/jdk-8u65-linux-x64.rpm && \
    wget https://mirror.bit.edu.cn/apache/tomcat/tomcat-8/v8.5.59/bin/apache-tomcat-8.5.59.tar.gz -O /tmp/apache-tomcat.tar.gz && \
    tar -xvf /tmp/apache-tomcat.tar.gz -C ${WORKSPACE}/ && \
    chmod 755 -R ${CATALINA_HOME}/bin && \
    rm -rf /tmp/apache-tomcat.tar.gz && \
    yum clean all